/* 收藏和笔记共用 */
var mongoose = require("mongoose");
/****************************
 * label
 * 标签
 ****************************/
var labelProps = {
	Name: {
		type: String,
		default: "",
	}, //标签名字
	CreateAt: {
		type: String,
		default: "",
	}, //创建日期
	UpdateAt: {
		type: String,
		default: "",
	}, //更新日期
	OrderNum: {
		type: Number,
		default: 0,
	}, //排序序号
	CreatorId: mongoose.Schema.ObjectId, //创建人id
	SchemeId: mongoose.Schema.ObjectId,
};
var labelSchema = new mongoose.Schema(labelProps);
var label = mongoose.model("label", labelSchema);

/****************************
 * collectionItem
 * 收藏条目
 ****************************/
var collectionItemProps = {
	CreateAt: {
		type: String,
		default: "",
	}, //创建日期
	UpdateAt: {
		type: String,
		default: "",
	}, //更新日期
	OrderNum: {
		type: Number,
		default: 0,
	}, //排序序号
	CreatorId: mongoose.Schema.ObjectId, //创建人id
	LabelId: mongoose.Schema.ObjectId,
	PostId: mongoose.Schema.ObjectId, //关联消息 可为空
	SchemeId: mongoose.Schema.ObjectId,
	Type: {
		type: String,
		default: "",
	}, //类型，globalVar.collectionTypeLabel
	Content: {
		type: String,
		default: "",
	}, //收藏内容 笔记才有
	Title: {
		type: String,
		default: "",
	}, //收藏笔记标题
	//图片附件[{CreatorId,_id,CreateAt,PreviewPath,FileType,Extension,Size,DisplayName,Name,}]
	Image: Array,
	//地理位置{name,address,city,latitude,longitude}
	Position: Object,
};
var collectionItemSchema = new mongoose.Schema(collectionItemProps);
var collectionItem = mongoose.model("collectionItem", collectionItemSchema);

module.exports = {
	label,
	collectionItem,
};
